package com.ytjj.qmyx.supplychain.service;

import com.github.pagehelper.PageHelper;
import com.ytjj.qmyx.supplychain.common.api.CommonPage;
import com.ytjj.qmyx.supplychain.common.model.request.QueryOrderRecordRequest;
import com.ytjj.qmyx.supplychain.common.model.response.BankerExportRecordResponse;
import com.ytjj.qmyx.supplychain.mapper.BankerExportRecordMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Slf4j
@Service
public class BankerExportRecordService {
    @Resource
    private BankerExportRecordMapper bankerExportRecordMapper;

    public CommonPage getBankerExportRecordList(QueryOrderRecordRequest queryOrderRecordRequest) {
        PageHelper.startPage(queryOrderRecordRequest.getPageNum(), queryOrderRecordRequest.getPageSize());
        List<BankerExportRecordResponse> bankerExportRecordResponses = bankerExportRecordMapper.selectBankerExportRecord(queryOrderRecordRequest.getBankerId(),queryOrderRecordRequest.getExportType());
        CommonPage commonPage = CommonPage.restPage(bankerExportRecordResponses);
        return commonPage;
    }

}
